ApiQueryLinks: Avoid MySQL order-by bug
MySQL (and MariaDB) have a strange bug where it will often get confused
and insist on filesorting if a field that is constant in the WHERE
clause is also present in ORDER BY. We've worked around this in several
places in the API, and in fact it was done in this very module in r34720
and r37250.
But when r67450 added the pltitles and tltemplates parameters, it didn't
adjust the logic for avoiding the DB bug. This does that now.
Change-Id: I9f37f8812a94cdd088d3940da43d1046ebd455d6